package com.dong.auth.security.authentication;

import com.dong.auth.security.exception.AuthenticationException;

/**
 *
 *  授权认证器提供者接口
 *
 * @author zhaodc
 * @date 2021/10/19 12:59
 **/
public interface AuthenticationProvider {

    /**
     * 用户登录时身份信息认证
     *
     * @param authentication 认证信息实例，登录时输入账号密码的封装
     * @return 认证成功之后的身份信息实体
     * @throw AuthenticationException
     */
    Authentication authenticate(Authentication authentication) throws AuthenticationException;

    /**
     * Returns <code>true</code> if this <Code>AuthenticationProvider</code> supports the
     * indicated <Code>Authentication</code> object.
     *
     */
    boolean supports(Class<?> authentication);
}
